import { getBannerApi } from '@/api/home'
import { onMounted, ref } from 'vue'
// 封装banner轮播图相关的业务代码
export const getBannerList = () => {
  //获取轮播图数据
  const bannerList = ref([])
  const getBannerList = async () => {
    const res = await getBannerApi({
      distributionSite: '2'
    })
    bannerList.value = res.result
  }
  onMounted(() => {
    getBannerList()
  })
  return {
    bannerList
  }
}